INCLUDES:=./  ./include
SRCS:=$(wildcard *.cc) 
LIBS:=  -lsrpc -lwfrest -lworkflow -lssl -lcrypto -lcrypt -lprotobuf
ALIBABALIBS:=  -fno-rtti -lalibabacloud-oss-cpp-sdk -lcurl -lpthread
AMQPCLIENTLIBS:= -lSimpleAmqpClient
OBJS:=$(patsubst %.cc, %.o, $(SRCS))
SERVER:=CloudServer.exe

# 目标 : 依赖
$(SERVER): main.o CloudiskServer.o token.o hash.o signup.pb.o
	g++ $^ -o $@ $(LIBS) $(AMQPCLIENTLIBS) $(addprefix -I, $(INCLUDES)) -g

%.o:%.cc
	g++ -c $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

HASH:=hash.exe
TOKEN:=token.exe
CONSUMER:=consumer.exe

$(HASH): hash.o testhash.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

$(TOKEN): token.o testToken.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

$(CONSUMER): Consumer.cc
	g++ $^ -o $@  $(AMQPCLIENTLIBS) $(ALIBABALIBS) -lcrypto

echo:
	echo $(INCLUDES)
	echo $(SRCS)

clean:
	rm -rf $(OBJS) $(SERVER) $(HASH) $(TOKEN) $(CONSUMER)
